Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleaned up signal handler and improved stack trace generation #5581

Merged
merged 7 commits into from
Feb 27, 2024

Conversation

firewave
Copy link
Collaborator

See #5540 (review) for related discussion.

@firewave
Copy link
Collaborator Author

This needs actual unit tests for the stack trace code. I have been meaning to do this for quite a while since they different in format between Windows and Linux. Also to leverage them in daca instead of calling gdb after a crash (see https://trac.cppcheck.net/ticket/11255).

@firewave firewave changed the title cli/cppcheckexecutorsig.cpp: cleaned up signal handler registration cleaned up signal handler and improved stack trace generation Oct 21, 2023
@firewave firewave force-pushed the stack branch 5 times, most recently from 3fc8c18 to 80d4aa7 Compare January 5, 2024 16:17
@firewave
Copy link
Collaborator Author

firewave commented Jan 5, 2024

This omits all frames above our own code now without adjusting the frame number:

$ test-signalhandler abort
Internal error: cppcheck received signal SIGABRT - abort or assertion
Callstack:
#4  0x7f57279ff50e in my_segv()
#5  0x7f57279ff5ac in cmake.output.signal/bin/test-signalhandler(main+0x70)
#6  0x7f57274676ca in /lib/x86_64-linux-gnu/libc.so.6(+0x276ca)

Please report this to the cppcheck developers!
Aborted (core dumped)

I guess I will make this behavior optional in case the code needs to show all frames in the future.

@firewave firewave force-pushed the stack branch 4 times, most recently from 0e21bd6 to 533669b Compare January 6, 2024 15:24
@firewave firewave merged commit f8aad8a into danmar:main Feb 27, 2024
64 checks passed
@firewave firewave deleted the stack branch February 27, 2024 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants